package com.base.service.impl;

import com.base.mapper.voipmapper.FilmMapper;
import com.base.po.voip.Film;
import com.base.service.FilmService;
import com.base.utils.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("filmService")
public class FilmServiceImpl implements FilmService {

    @Autowired
    private FilmMapper filmMapper;

    @Override
    public int deleteByPrimaryKey(String id) {
        return filmMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(Film record) {
        return filmMapper.insert(record);
    }

    @Override
    public int insertSelective(Film record) {
        return filmMapper.insertSelective(record);
    }

    @Override
    public Film selectByPrimaryKey(String id) {
        if (id == null || id.isEmpty()) {
            return null;
        }
        return filmMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(Film record) {
        return filmMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(Film record) {
        return filmMapper.updateByPrimaryKey(record);
    }

    @Override
    public int countByAll(String parentid, String filmname, String username, String adid, String ageid, Integer type) {
        return filmMapper.countByAll(parentid, filmname, username, adid, ageid, type);
    }

    @Override
    public List<Film> selectByAll(Page page, String parentid, String filmname, String username, String adid, String ageid, Integer type) {
        return filmMapper.selectByAll(page, parentid, filmname, username, adid, ageid, type);
    }

}
